export default (api) => {
  return (options, ...params) => {
    return new Promise((resolve, reject) => {
      api({
        ...options,
        success: resolve,
        fail: reject,
        catch: reject,
        ...params,
      })
    })
  }
}
